/*
 * can1.h
 *
 *  Created on: Oct 18, 2023
 *      Author: Jinming
 */

#ifndef INC_CAN1_H_
#define INC_CAN1_H_

#include "main.h"
#include "can.h"


void CAN1_RxFifo0MsgPendingCallback(CAN_HandleTypeDef *hcan);
void CAN1_tx_complete_callback(CAN_HandleTypeDef *hcan);
int can1_ext_write(uint32_t id, uint8_t *pData, uint8_t len);
int can1_std_write(uint32_t id, uint8_t *pData, uint8_t len);
int can1_config(int (*func)(void));
void can1_unconfig(void);
int can1_read(CANMsgRx_t *msg, uint32_t timeout);
void can1_rx_clear(void);

#endif /* INC_CAN1_H_ */
